package com.oocl.processor.impl;

import java.util.Comparator;
import java.util.List;

import com.oocl.analyser.Analyser;
import com.oocl.analyser.impl.AnalyserImpl;
import com.oocl.pojo.Customer;
import com.oocl.printer.DataPrinter;
import com.oocl.printer.impl.DataPrinterImpl;
import com.oocl.processor.DataProcessor;

/**
 * 处理过程实现
 * @author GANAB
 *
 */
public class DataProcessorImpl implements DataProcessor {
	private String format = null;
	private Analyser analyser = null;
	private DataPrinter printer = null;

	public DataProcessorImpl(List<Customer> list, String format) {
		this.format = format;
		this.analyser = new AnalyserImpl(list);
		this.printer = new DataPrinterImpl();
	}

	public StringBuilder process(Comparator<Customer> comp) {
		return this.printer.print(analyser.analyse(comp), format);
	}

}
